package com.snatch.common.vo;

import java.text.ParseException;

public class CommonUtil {

	/**
	 * @Title: parsePerfix
	 * @Description: 按照delimter截取rawStr成数组返回
	 * @author lilei
	 * @param rawStr原始字符串
	 * @param n 截取的结果是几个部分
	 * @param delimter分隔符
	 * @return
	 * @return String[] 截取结果
	 * @throws
	 */
	public static String[] parsePerfix(String rawStr, int n, String delimter) {
		String[] strArr = new String[n];
		int pos = 0;
		for (int i = 0; i < n - 1; i++) {
			pos = rawStr.indexOf(delimter);
			strArr[i] = rawStr.substring(0, pos);
			rawStr = rawStr.substring(pos + 1);
		}
		strArr[n - 1] = rawStr;
		return strArr;
	}

	
	
	
	
	/**
	* @Title: main
	* @Description: 测试方法
	* @author lilei 
	* @param args
	* @throws ParseException
	* @return void        返回类型
	* @throws
	*/
	public static void main(String[] args) throws ParseException {
	
	}
}
